var express = require('express');
var router = express.Router();

const { getTypesById, getTypes, addTypes, modifyTypes, delTypes ,getTypesInsures} = require('../service/typesService')

//根据ID保险分类
router.get('/getTypesById', async function (req, res, next) {
    return res.send(await getTypesById(req.query))
});

//获取所有保险分类
router.get('/getTypes', async function (req, res, next) {
    return res.send(await getTypes(req.query))
});
//获取所有保险分类
router.get('/getTypesInsures', async function (req, res, next) {
    return res.send(await getTypesInsures(req.query))
});

//新增保险分类
router.post('/addTypes', async function (req, res, next) {
    return res.send(await addTypes(req.body))
});

//修改保险分类
router.post('/modifyTypes', async function (req, res, next) {
    return res.send(await modifyTypes(req.body))
});

//删除保险分类
router.post('/delTypes', async function (req, res, next) {
    return res.send(await delTypes(req.body))
});


module.exports = router;